package com.biz.controller.basic;

import com.biz.service.basic.ShopServiceI;
import com.framework.controller.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.InitBinder;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

/**
 * 商户设置相关
 * Created by liujiajia on 2016/11/14.
 */
@Controller
@RequestMapping("/shop")
public class ShopController extends BaseController {

    @Autowired
    private ShopServiceI shopService;


    @InitBinder("pshop")
    public void initBinderFormBean1(WebDataBinder binder) {
        binder.setFieldDefaultPrefix("pshop.");
    }

    @RequestMapping("loadShopList")
    public void loadAgentList(HttpServletResponse response, HttpServletRequest request,String id) throws Exception {
        List<Map<String,String>> list=shopService.loadShopList(id);

        writeJson(list,response);
    }
}
